[shadow] Be smarter about what we check to avoid unnecessary brute-force searches
authorGeorge Dunlap <gdunlap@xensource.com>
Wed, 19 Sep 2007 10:58:04 +0000 (11:58 +0100)
committerGeorge Dunlap <gdunlap@xensource.com>
Wed, 19 Sep 2007 10:58:04 +0000 (11:58 +0100)
commitf0ad89dd9dfe20f03c6b49845a04521086ef32a2
tree18e4dc7053b30fc63ddbf0cc01c344a49dcb31bf
parentc8822fb01990bf7f48c02d9cc159ea40655c7d16
[shadow] Be smarter about what we check to avoid unnecessary brute-force searches

The old code checked only if the page was still a pagetable before
doing a brute-force search, rather than checking if it was still
shadowed as the type indicated.  This meant that if a page was shadowed
as two different types, it was guaranteed to do a full brute-force search
even if all references could be found by up-pointers.

This checks the proper thing so that it will only do a brute-force if
necessary.

It also re-orders the unshadows so that higher levels are done first.  In
many cases, lower-level shadows will be destroyed in the process of
higher-level shadows being destroyed, again saving brute-force searches.
xen/arch/x86/mm/shadow/common.c